package the_Crash;

import repast.simphony.engine.environment.RunEnvironment;
import repast.simphony.parameter.Parameters;

/**
 * @author Hariharan
 *
 */
public class ParameterResolver {
	

	private static Parameters params;
	
	public static void globalReset(){
		params = RunEnvironment.getInstance().getParameters();

		// Check for the percentages
		params.setValue("smartCar", Math.min(100, params.getDouble("smartCar")));
		params.setValue("smartSignal", Math.min(100, params.getDouble("smartSignal")));
	}
	
	//how many cells the sidelength of a block is
	public static int getBlockSize() {
	 return	params.getInteger("blockSize");		
	}
	//how many vertical and horizontal streets there are
	public static int getCitySize() {
		return params.getInteger("citySize");
	}
	//sets a limit on the number of cars allowed in the city
	public static int getMaximumCars() {
		return params.getInteger("maxCarsInWorld");
	}
	//a percentage which sets the ratio of smart to dumb cars
	public static double getSmartCar() {
		 return	params.getDouble("smartCar");		
		}
	//a percentage which sets the ratio of smart to dumb signals
	public static double getSmartSignal() {
		 return	params.getDouble("smartSignal");		
		}
	//number of ticks in a smartSignal's cycle
	public static int getSmartCycleLength() {
		 return	params.getInteger("smartCycleLength");		
		}
	//number of ticks in a dumbSignal's cycle
	public static int getDumbCycleLength() {
		 return	params.getInteger("dumbCycleLength");		
		}
	//how varied the dumbSignal's cycle lengths can be
	public static int getDumbCycleSpread() {
		 return	params.getInteger("dumbCycleSpread");		
		}
	//how long the simulation will run
	public static int getTerminationTick() {
		 return	params.getInteger("terminationTick");		
		}
	//how far smartCars can send messages
	public static int getCommunicationDistance(){
		return params.getInteger("communicationDistance");
	}
	//minimum time to clean up an accident
	public static int getMinCleanUpTime(){
		return params.getInteger("minCleanUpTime");
	}
	//maximum time to clean up an accident
	public static int getMaxCleanUpTime(){
		return params.getInteger("maxCleanUpTime");
	}
}
